﻿/*
*************************************************************************
    Craft is an othello program with relatively high AI.
    Copyright (C) 2008-2011  Patrick

    This file is part of Craft.

    Craft is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Craft is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Craft.  If not, see <http://www.gnu.org/licenses/>.

    Craft-Othello on Google Code: <http://code.google.com/p/craft-othello/>

    Patrick's E-mail: patrick880905@sina.com
    Patrick's Blog: <http://blog.sina.com.cn/patwonder>
*************************************************************************
*/

#pragma once
#include "Common.h"

namespace Othello {

public ref class BoardResolver {
public:
	static array<System::Char>^ DELIMERS = { L'\t', L' ' };
	static array<System::Char>^ BLACK = { L'X', L'B', L'*' };
	static array<System::Char>^ WHITE = { L'O', L'W', L'0' };
	static const System::Char EMPTY = L'-';

private:
	static Chess parseChess(System::Char ch);
	static Board^ parseBoard(System::String ^ffopos_board);
	static Chess parseMover(System::String ^ffopos_mover);
	static System::Char chessToChar(Chess chess);

public:
	static Chess processBoard(System::String ^ffopos, Board ^board);
	static System::String^ getBoardString(Board ^board, Chess mover);
};

} // namespace Othello
